package com.ofhb.webapp.client.utils;

import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;

public class LoadingAnimation extends PopupPanel {
	private FlexTable ftBase;

	public LoadingAnimation() {
		
		super(true);
		setModal(true);
//		setAnimationEnabled(true);
		setAutoHideEnabled(false);
		setGlassEnabled(true);
		center();
		
		ftBase = new FlexTable();
		setWidget(ftBase);
		
		Image image = new Image("loading.gif");
		ftBase.setWidget(0, 0, image);
		
		Label lblNewLabel = new Label("Please Wait...");
		ftBase.setWidget(1, 0, lblNewLabel);
	}
	
//		@Override
//		public void show() {
////			super.show();
////			
////				int pleft =  getParent().getAbsoluteLeft();
////				int pwidth =  getParent().getAbsoluteLeft()+ getParent().getOffsetWidth();
////				int cWidth = 125;
////				int x=pleft+(pwidth-cWidth)/2;
////				
////				int ptop =  getParent().getAbsoluteTop();
////				int pheight =  getParent().getAbsoluteTop()+ getParent().getOffsetHeight();				
////				int cHeight = 150;
////				int y =  ptop+((pheight-cHeight)/2);
////				setPopupPosition(x,y);
//			center();
//			}
	public FlexTable getApBase() {
		return ftBase;
	}
}
